<?php echo $this->load->view('meta'); ?>
<title>xa-ncsu | admin - users</title>
<link rel="stylesheet" href="<?=base_url()?>css/admin.css" type="text/css" media="screen" />
<link rel="stylesheet" href="<?=base_url()?>css/impromptu.css" type="text/css" media="screen" />
<script type="text/javascript" src="<?=base_url();?>js/jquery-impromptu.1.2.js"></script>
<script>
function vhconfirm(v,m)
        {
            if( v )
            {
                var f =  document.createElement("form");document.body.appendChild(f);f.method = "POST";f.action = $("#" + v ).attr( "href" );f.submit();
            } else
            {
                return false;
            }
        }
</script>
<?php echo $this->load->view('header'); ?>
<h3>Registered Users</h3>
<?php if ($users->num_rows() > 0): ?>
<table>
<tr>
	<th>username</th>
	<th>first name</th>
	<th>last name</th>
	<th>display</th>
	<th>email</th>
	<th>last visit</th>
	<th>actions</th>
</tr>
<?php foreach ($users->result() as $row) : ?>
<tr>
	<td><?=$row->username?></td>
	<td><?=$row->firstname?></td>
	<td><?=$row->lastname?></td>
	<td><?=$row->display?></td>
	<td><?=$row->email?></td>
	<td><?=$row->daysago;?></td>
	<td>
		<a href="<?=site_url();?>users/profile/<?=$row->userid?>"><img src="<?=base_url();?>img/icons/user_go.png" alt="View Profile" title="View Profile" /></a>
		<a href="<?=site_url();?>mail/composeMail/user/<?=$row->userid?>"><img src="<?=base_url();?>img/icons/email_go.png" alt="Email User" title="Email User" /></a>
		<a href="<?=site_url();?>admin/deleteUser/<?=$row->userid?>" id="conf<?=$row->userid?>" onclick="$.prompt('Delete User?',{callback: vhconfirm, buttons: { Yes : 'conf<?=$row->userid?>', No : false}}); return false;">
			<img src="<?=base_url();?>img/icons/delete.png" alt="Delete User" title="Delete User" /></a>
		<?php if($row->salt != NULL):?><img src="<?=base_url();?>img/icons/tick.png" alt="Salted" title="Salted" /><?php endif; ?>
	</td>
</tr>
<?php endforeach; ?>
</table>
Users: <?=$users->num_rows()?><br />
Unsalted Users: <?=$unsalted?><br />
<?=anchor('admin/updateDisplayNames', 'Update Display Names')?>
<?php endif; ?>
<?php echo $this->load->view('footer'); ?>